//
//  SHHTMLTool.m
//  youjian02
//
//  Created by 常琼 on 14/10/8.
//  Copyright (c) 2014年 com.shouhuobao. All rights reserved.
//

#import "SHHTMLTool.h"

@implementation SHHTMLTool



/**
 *  加载本地网页
 */
+(void)htmlWithName:(NSString *)name andWebView:(UIWebView *)webView
{
    NSString *htmlPath = [[NSBundle mainBundle] pathForResource:name
                                                         ofType:@"html"];
    NSData *data = [NSData dataWithContentsOfFile: htmlPath];
    NSString *info = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    [webView loadHTMLString:info baseURL:[NSURL fileURLWithPath: htmlPath]];
}

/**
 *  加载远程网页
 */
+(void)htmlWithName2:(NSString *)name andWebView:(UIWebView *)webView2
{
    NSURL *url=[NSURL URLWithString :name];
    NSURLRequest *request=[ NSURLRequest requestWithURL :url];
    [webView2 loadRequest :request];
}

@end
